﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using dis.sys.hw1.Model;

namespace dis.sys.hw1.Contract
{
    /*
     * interface of the service of the hotel searches, booking and canceling
     */
    [ServiceKnownType(typeof(Hotel))]
    [ServiceKnownType(typeof(HotelRoom))]
    [ServiceContract]
    public interface ISearchService
    {
        [WebGet(UriTemplate = "isup")]
        [OperationContract]
        bool IsUp();

        [WebGet(UriTemplate = "?fromDate={fromDateTicks}&toDate={toDateTicks}&minStars={minStars}&minRating={minRating}")]
        [OperationContract]
        [QueryCaching]
        IList<Hotel> Search(long fromDateTicks, long toDateTicks, double minStars, double minRating);

        IDictionary<Tuple<long, long, double, double>, Tuple<DateTime, IList<Hotel>>> QueryCache { get; set; }

        #region oldinterface
        //[WebGet(UriTemplate = "{hotelName}?roomNumber={roomNumber}&fromDate={fromDateTicks}&toDate={toDateTicks}")]
        //[OperationContract]
        //int Book(long fromDateTicks, long toDateTicks, int roomNumber, string hotelName);

        //[WebInvoke(Method = "DELETE", UriTemplate = "{hotelName}?bookingId={bookingId}")]
        //[OperationContract]
        //bool Cancel(int bookingId, string hotelName);
        #endregion
    }
}
